#include "stdafx.h"

Actor::Actor()
{
	position.set(0,0,0);
}

Actor::~Actor()
{}

vec3f Actor::localToWorld(const vec3f& vec) const
{
	vec3f worldRef;
	worldRef = rotation * vec;
	return worldRef;
}

vec3f Actor::worldToLocal(const vec3f& vec) const
{
	vec3f localRef;
	localRef = rotation.conjugate() * vec;
	return localRef;
}

void Actor::setPosition( const vec3f& pos )
{
	position.x = pos.x;
	position.y = pos.y;
	position.z = pos.z;
}

void Actor::rotate(const vec3f& axis, float radius)
{
	quatf quatRot(axis, radius);

	mat4f valid,rot1,rot2;
	quatRot.getMatrix(valid);
	rotation.getMatrix(rot1);

	rotation = quatRot * rotation;

	rotation.getMatrix(rot2);
}